#include <iostream>

using namespace std;

int func(int);
int *func(int&);

int (*funcPtr)(int);
int* (*iptrFuncPtr)(int&);

void caller(int (*)(int), int);
void caller(int* (*)(int&), int);

int func(int param){
	cout << param << endl;
	return param + 1;
}

int* func(int &param){
	cout << param ++<< endl;
	return &param;
}

void caller(int (*fP)(int), int value){
	// cout << (*fP)(value) << endl; // This statement works well too
	cout << fP(value) << endl;
}

void caller(int* (*fP)(int&), int value){
	cout << fP(value) << endl;
	cout << *fP(value) << endl;
}

int mmain(){
	funcPtr = func; // without this clause will cause an exception
	caller(funcPtr, 10);

	cout << endl << endl;

	iptrFuncPtr = func;
	caller(iptrFuncPtr, 110);

	return 0;
}